//a pure virtual function may both be defined and invoked, provided it is invoked
//1. statically and 
//2. not throught the virtual mechanism.

#include <iostream>
using namespace std;

class Base{
public:
  virtual void foo() =0;
};
void Base::foo(){cout<<"Base::foo()"<<endl; }

class Derived:public Base{
  void foo(){ cout<<"in Derived:"; Base::foo();cout<<"Derived::foo()"<<endl; }
public:
  int i;
};

int main()
{
 //  Base::foo();//error
  Base* ptr = new Derived;
  ptr->foo();
}

